package de.fuberlin.inf.dbs.ue07;

import java.util.LinkedList;

public class Province {
	private String name;
	public static LinkedList<Province> instances;
	
	/**
	 * provinces can be identified by their name
	 * @param name
	 * @return
	 */
	public static Province getInstance(String name) {
		if (Province.instances == null)
			Province.instances = new LinkedList<Province>();
		else
			for (Province p : Province.instances)
				if (p.name.equals(name))
					return p;
		Province p = new Province(name);
		Province.instances.add(p);
		return p;
		
	}
	
	private Province(String name) {
		this.name = name;
	}

	public String getName() {
		return this.name;
	}
}
